-
Notifications
You must be signed in to change notification settings - Fork 16
[XeVM] Add initial set of operations and conversion tests #421
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
e0a6fda to
d59728f
Compare
3845562 to
3315f73
Compare
kurapov-peter
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good with the map for cache levels and the width/pitch/height description (not necessary atm)
a96e86c to
349bf35
Compare
|
|
||
| namespace { | ||
|
|
||
| enum CacheLevel { L1, L2, L3 }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| enum CacheLevel { L1, L2, L3 }; | |
| enum class CacheLevel { L1, L2, L3 }; |
| getCacheControlMetadata(ConversionPatternRewriter &rewriter, OpType op, | ||
| const bool isLoad, const std::string &chip) { | ||
| if ((op.getL1CacheControlAttr() == | ||
| xevm::L1StoreCacheControlAttr::get( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| xevm::L1StoreCacheControlAttr::get( | |
| L1StoreCacheControlAttr::get( |
You may omit the namespace here and below or remove using namespace xevm, seems it's never used.
| static LLVM::CallOp createDeviceFunctionCall( | ||
| ConversionPatternRewriter &rewriter, StringRef funcName, Type retType, | ||
| ArrayRef<Type> argTypes, ArrayRef<Value> args, | ||
| mlir::ArrayRef<std::pair<unsigned, mlir::StringRef>> paramAttrs, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| mlir::ArrayRef<std::pair<unsigned, mlir::StringRef>> paramAttrs, | |
| ArrayRef<std::pair<unsigned, StringRef>> paramAttrs, |
To be consistent with other args.
| return llvm::ConstantAsMetadata::get(llvm::ConstantInt::get(type, val)); | ||
| } | ||
|
|
||
| static LogicalResult handleDecorationCacheControl(Operation *op, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems the op argument is never used.
349bf35 to
c3e7f25
Compare
This PR adds XeVM load/store/prefetch operations and their conversion patterns to llvm. We follow the Triton approach with slight changes (e.g., the cache attribute is handled differently).